package antLogic;

/**
 * Created by IntelliJ IDEA.
 * User: home
 * Date: Jul 11, 2007
 * Time: 10:12:11 PM
 * To change this template use File | Settings | File Templates.
 */
public class Segment {

    Integer length;
    Counter bearing;

    public Segment(int length, Counter bearing)  {
        this.length = length;
        this.bearing = bearing;
    }

    public Integer getLength() {
        return length;
    }

    public Counter getBearing() {
        return bearing;
    }

    public int getWidth()  {
        double angle =  Math.toRadians(bearing.getValue());
        return (int)(length * (Math.sin(angle)));
    }

    public int getHeight()  {
        double angle =  Math.toRadians(bearing.getValue());
        return (int)(length * (Math.cos(angle))); 
    }
}
